<template>
  <view class="good_info_container">
    <!-- 商品展示区域 -->
    <view class="goods_container">
      <view
        class="goodsInfo_box"
        v-for="(item, index) in goodsList"
        :key="index"
      >
        <view class="goodsinfo">
          <image class="avatar" :src="item.pos_pic" @tap="go_detail(item)"></image>
          <view class="right">
            <view class="goods_title">{{ item.cut_item_title }}</view>
            <view class="goods_btn">
              <van-button custom-class="btn public" @tap="audi(item)">
                审核
              </van-button>
              <van-button custom-class="btn" @tap="edit(item)">查看编辑</van-button>
            </view>
          </view>
        </view>
        <view class="goodsdata">
          <view class="data_title">
            <view class="price gray">需砍次数</view>
            <view class="commision gray">每人次数</view>
            <view class="status gray">倒计时</view>
            <view class="num_remain gray">保底价/元</view>
          </view>
          <view class="data_count">
            <view class="price black"
              >{{ item.need_times}}</view
            >
            <!-- {{ item.hour}}:{{item.minutes}} -->
            <view class="commision black"
              >{{ item.one_people_times }}</view
            >
            <view class="status black">{{ item.hour}}:{{item.minutes}}</view>
            <view class="num_remain black">{{
              item.cut_price
            }}</view>
          </view>
        </view>
      </view>
    </view>
    <!-- 商品展示区域 -->
  </view>
</template>

<script>
import { update_status } from "../../../utils/imapi";
const statusList = {
  0: "仓库中",
  1: "上架审核",
  2: "提审中",
  3: "审核成功",
  4: "审核失败",
};
export default {
  name: "GoodInfo",
  props: {
    goodsList: {
      type: Array,
      required: true,
    },
    type: {
      type: String,
    },
  },
  components: {},
  data() {
    return {
      statusList,
    };
  },
  computed: {},
  watch: {},
  onLoad() {
    console.log(this.goodsList);
    console.log(this.type);
  },
  onReady() {},
  onShow() {},
  methods: {
    go_detail(item) {
      console.log(item);
      uni.navigateTo({
         url: '/pages/goods_detail/goods_detail?id='+item.item_id+'&p='+item.p
      });
    },
     audi(item) {
      this.$emit('audi',item)
    },
     edit(item) {
      this.$emit('edit',item)
    },
    set_mchnear_goods(item) {
      this.$emit("set_goods", item);
    },
    set_tj_goods(item) {
      this.$emit("set_tg", item);
    },
  },
  onReachBottom() {},
  onHide() {},
};
</script>

<style scoped lang="scss" scoped>
.goods_container {
    padding-bottom: 90upx;
  .goodsInfo_box {
    padding: 32upx;
    border-bottom: 16upx solid #f0eefd;
    .goodsinfo {
      display: flex;
      align-items: center;
      margin-bottom: 20upx;
      .avatar {
        width: 160upx;
        height: 160upx;
        margin-right: 20upx;
      }
      .right {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .goods_title {
          width: 494upx;
          max-height: 80upx;
          text-align: left;
          font-size: 26upx;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #0a0819;
          text-overflow: ellipsis;
          overflow: hidden;
        }
        .goods_btn {
          display: flex;
          align-items: center;
          justify-content: flex-end;
          margin-bottom: 10upx;
          /deep/ .btn {
            min-width: 160upx;
            height: 64upx;
            background: #fff;
            border-radius: 10upx;
            font-size: 26upx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #0a0819;
            line-height: 64upx;
            text-align: center;
            margin-left: 10upx;
          }
          /deep/ .public {
            background: #6d55ed !important;
            color: #ffffff !important;
          }
        }
      }
    }
    .goodsdata {
      .data_title,
      .data_count {
        display: flex;
        .price {
          width: 224upx;
          padding-left: 20upx;
        }
        .commision {
          width: 136upx;
          padding-left: 14upx;
        }
        .status {
          width: 132upx;
          padding-left: 14upx;
        }
        .num_remain {
          width: 200upx;
          text-align: right;
          padding-right: 20upx;
        }
        .black {
          border: 1px solid #f0eefd;
        }
      }
      .data_title {
        height: 38upx;
        font-size: 10upx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #727278;
        line-height: 38upx;
      }
      .data_count {
        height: 58upx;
        font-size: 26upx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #0a0819;
        line-height: 58upx;
      }
    }
  }
}
</style>
